@using EventHub.Web.Pages.Events.Components.CreateOrEditEventArea
@using Microsoft.AspNetCore.Http
@model EventHub.Web.Pages.Events.Components.CreateOrEditEventArea.CreateOrEditEventAreaViewComponent.NewEventViewModel

@{
    if (Model is null)
    {
        throw new BadHttpRequestException("");
    }

    var eventId = ViewData["EventId"] as Guid?;
    var eventUrlCode = ViewData["EventUrlCode"]?.ToString();

    var result = Enum.TryParse(ViewData["StepType"]!.ToString(), out CreateOrEditEventAreaViewComponent.ProgressStepType stepType);
    if (!result)
    {
        throw new BadHttpRequestException("");
    }
}

<div id="EventContainer" style="@(stepType != CreateOrEditEventAreaViewComponent.ProgressStepType.Event ? "display: none" : "")">
    <partial name="_eventSection.cshtml" model="@Model"/>
</div>
<div id="TrackContainer" style="@(stepType != CreateOrEditEventAreaViewComponent.ProgressStepType.Track ? "display: none" : "")">
    <partial name="_trackSection.cshtml" model="@Model.Tracks"/>
</div>
<div id="SessionContainer" style="@(stepType != CreateOrEditEventAreaViewComponent.ProgressStepType.Session ? "display: none" : "")">
    <partial name="_sessionSection.cshtml" model="@Model.Tracks"/>
</div>
<div id="PreviewContainer" style="@(stepType != CreateOrEditEventAreaViewComponent.ProgressStepType.Preview ? "display: none" : "")">
    <partial name="_previewSection.cshtml" model="@Model"/>
</div>

<input type="hidden" id="EventId" value="@eventId"/>
<input type="hidden" id="EventUrlCode" value="@eventUrlCode"/>
